package sau.diyizu.media.common;

import android.database.Cursor;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

/**
 @author JYD
 @version 1.0
 @since 2020/12/27 15:18 */
public class BaseFragment extends Fragment {

    protected void toast(String msg) {
        Toast.makeText(requireContext(), msg, Toast.LENGTH_SHORT).show();
    }

    @Nullable
    protected static String getString(Cursor c, int index) {
        return index != -1 ? c.getString(index) : null;
    }

    @Nullable
    protected static Long getLong(Cursor c, int index) {
        return index != -1 ? c.getLong(index) : null;
    }

    @Nullable
    protected static Integer getInt(Cursor c, int index) {
        return index != -1 ? c.getInt(index) : null;
    }
}